<?php $this->load->view('admin_home/_header')?>
<?php $this->load->view('message') ?>
<script type="text/javascript">
  $().ready(function(){
    $("#school_li").addClass("active");    
  });

    function delete_item(id)
    {
        if(confirm("将删除该管理员，删除后不可恢复，确定吗？"))
            location.href="<?php echo site_url('admin_school/school_admin_delete').'/'?>"+id;
    }
</script>
<div class="container">
    <div class="col-md-3">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">学校信息</h3>
            </div>
             <div class="panel-body">
                <div class="row form-group" style="border-bottom:1px ridge;">
                  <label  class="col-lg-5 control-label">名称</label>
                  <div class="col-lg-7">
                        <label  class="ontrol-label"><?=$school['name']?></label>
                  </div>
                </div>
                <div class="row form-group" style="border-bottom:1px ridge;">
                  <label  class="col-lg-5 control-label">专业</label>
                  <div class="col-lg-7">
                        <label  class="ontrol-label"><?=$major_count?></label>
                  </div>
                </div>
                <div class="row form-group" style="border-bottom:1px ridge;">
                  <label  class="col-lg-5 control-label">教师</label>
                  <div class="col-lg-7">
                        <label  class="ontrol-label"><?=$teacher_count?></label>
                  </div>
                </div>
                 <div class="row form-group" style="border-bottom:1px ridge;">
                  <label  class="col-lg-5 control-label">授课班</label>
                  <div class="col-lg-7">
                        <label  class="ontrol-label"><?=$logic_class_count?></label>
                  </div>
                </div>
                <div class="row form-group" style="border-bottom:1px ridge;">
                  <label  class="col-lg-5 control-label">学生</label>
                  <div class="col-lg-7">
                        <label  class="ontrol-label"><?=$student_count?></label>
                  </div>
                </div>
               
            </div>
        </div>
    </div>
    <div class="col-md-9">
            
            <div class="row">
                <?php if($school_admins) {?>
                    
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                <h3 class="panel-title">
                                    学校管理员列表
                                </h3>
                            </div>
                            <div class="panel-body">
                                <div id="table">
                                    <table class="table table-striped table-hover ">
                                        <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>用户名</th>
                                                <th>姓名</th>
                                                <th>操作</th>
                                                
                                                <th>
                                                    <a href="<?php echo site_url('admin_school/school_admin_add').'/'.$school['id']?>" class="btn btn-primary ">
                                                    添加
                                                    </a>
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php $school_admin_index=1; ?>
                                            <?php foreach ($school_admins as $school_admin_item ): ?>
                                            <tr>
                                                <td>
                                                    <?php echo $school_admin_index++ ;?></td>
                                                <td>
                                                    <?php echo $school_admin_item['username']?></td>
                                                <td>
                                                    <?php echo $school_admin_item['name']?></td>
                                                <td></td>
                                                <td>
                                                    <a onclick="delete_item(<?=$school_admin_item['id']?>)" href="#">删除</a>
                                                </td>
                                            </tr>
                                            <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    
                <?php } else {?>
                    <a href="<?php echo site_url('admin_school/school_admin_add').'/'.$school['id']?>" class="btn btn-primary ">
                    暂无管理员，点击添加
                    </a>
                <?php }?>
            </div>
    </div>
</div>
<?php $this->load->view('admin_home/_footer')?>